
<div class="panel panel-default panel-intro">

    <div class="panel-heading">
        {:__('Info')}
    </div>

    <div class="panel-body newrow">
        <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" onsubmit="return true">
            <input type="hidden" name="row[ids]" value="{$detail[0]['id']}">
            <div class="row">
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Code')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-code" class="form-control" value="{$detail[0]['code']}" name="row[code]" type="text">
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Customer_name')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input  data-rule="required;" readonly="readonly" id="c-supplier" class="form-control" type="text" value="{$detail[0]['customer_name']}"  >
                        <input  id="c-supId" class="form-control" value="{$detail[0]['customer_info_id']}"  name="" style="display: none;" type="text"  data-toggle="modal" data-target="#myModal">
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Sell_code')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input readonly="readonly" id="c-purchase" value="{$detail[0]['sell_code']}" class="form-control" type="text">
                        <input id="c-pur" class="form-control" name="" value="{$detail[0]['sell_id']}" style="display: none;"
                               type="text">
                        <input id="c-code" class="form-control" name="" value="{$detail[0]['sell_code']}" style="display: none;"
                               type="text">

                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Linkman')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-contact" value="{$detail[0]['linkman']}" class="form-control" name="row[linkman]" type="text">
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Phone')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-phone" value="{$detail[0]['phone']}" class="form-control" name="row[phone]" type="text" >
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-3">{:__('Billing_time')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <input id="c-billing_date" class="form-control datetimepicker" data-date-format=" YYYY-MM-DD" data-date-default-date="{$detail[0]['billing_time']|date="Y-m-d",###}" name="row[billing_time]" type="text" >
                    </div>
                </div>
                <div class="col-md-4 col-xs-12 form-group">
                    <div class="form-inline" data-toggle="cxselect" data-selects="first,second">
                        <label class="control-label col-xs-12 col-sm-3">{:__('Warehouse')}:</label>
                        <div class="col-xs-12 col-sm-9">
                            <select id="hose-fist" class="first form-control" date-rule="required;"
                                    name="row[warehouse_id]" data-url="ykjp/sell/sellreturn/getWarehouse?type=page"
                                    style="width: 35%">
                                <option value="{$detail[0]['warehouse_id']}" selected=""></option>
                            </select>
                            <select id="hose-second" class="second form-control" name="row[partition_id]"
                                    data-url="ykjp/sell/sellreturn/getWarehouse" data-query-name="pid" style="width: 35%">
                                <option value="{$detail[0]['partition_id']}" selected=""></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
                    <div class="col-xs-12 col-sm-6" >
                        <input id="c-city" var date-rule="required;" data-toggle="city-picker" class="form-control" name="row[city]" type="text" value="{$detail[0]['city']|htmlentities}" >
                    </div>
                    <div class="col-xs-12 col-sm-4" >
                        <input type="text" id="c-address" value="{$detail[0]['address']}" name="row[address]" class="form-control" placeholder="输入详细地址" name="">
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-md-6 col-xs-12 form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
                    <div class="col-xs-12 col-sm-6">
                        <textarea id="c-remark" class="form-control " rows="3" name="row[remark]" cols="30">{$detail[0]['remark']}</textarea>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table id="table" class="table table-striped table-bordered table-hover table-nowrap">
                    <thead>
                    <th>{:__('Serial number')}</th>
                    <th>{:__('Sku')}</th>
                    <th>{:__('Commodity')}</th>     
                    <th>{:__('Specification')}</th>
                    <th>{:__('Attributes')}</th>
                    <th>{:__('Unit')}</th>
                    <th>{:__('Sales volume')}</th>
                    <th>{:__('Return num')}</th>
                    <th>{:__('unit price')}</th>
                    <th>{:__('Subtotal')}</th>
                    <th>{:__('Remarks')}</th>
                    <th>{:__('Operate')}</th>
                    </thead>
                    <tbody>
                        {foreach :$product as $key=>$vo } 
                        <tr>
                            <td class="prid" data-id="{$vo.id}">{$key+1}</td>
                            <td>{$vo.products['sku']}</td>
                            <td><input readonly="readonly" date-rule="required;" value="{$vo.products['name']}"  type="text" name="" data-id="{$vo.product_id}" class="find" class="" ></td>
                            <td>{$vo.products['specification']}</td>
                            <td>
                                {volist name="$vo.products['prop']" id="val"}
                                {$val.title}:{:isset($val.value)?$val.value:""}
                                {/volist}
                            </td>
                            <td class="unit">{$vo.products['unit']}</td>
                            <td class="inventory">{$vo.products['volume']}</td>
                            <td><input value="{$vo.nums}"  type="number" name="" data-rule="required;integer;range(0~);"  class="nums find2" onblur="totalNums(this)"></td>
                            <td><input  type="number" value="{$vo.price}" data-rule="required;" onblur="calMoney(this)" class="unit-price" name=""></td>
                            <td class="subtotal">{$vo.subtotal}</td>
                            <td> <textarea rows="2" class="remarks" cols="20">{$vo.remark}</textarea></td>
                            <td>
                                <button type="button" disabled="disabled" class="btn btn-primary" onclick="addRow()">{:__('Add')}</button>
                                <button type="button" class="btn btn-default" onclick="delRow(this)">{:__('Delete')}</button>
                            </td>

                            {/foreach}

                        </tr>
                        <tr>
                            <td>{:__('Total')}</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td class="totalnums">{$detail[0]['totalNums']}</td>
                            <td></td>
                            <td id="allMoney">{$detail[0]["allMoney"]}</td>
                            <td></td>
                            <td></td>
                        </tr>

                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="col-md-10 col-xs-12">
                </div>
                <div class="col-md-2 col-xs-12">
                    <div class="col-xs-12 col-sm-5">
                    </div>
                    <button type="button" onclick="submitUpdate()" class="btn btn-success btn-embossed">{:__('OK')}</button>
                </div>
            </div>
        </form>

    </div>

</div>




